package com.shcowin.biz.impl;

import java.util.List;

import javax.inject.Inject;

import org.springframework.dao.DataAccessException;
import org.springframework.stereotype.Service;

import com.shcowin.biz.ContactBiz;
import com.shcowin.dao.ContactDao;
import com.shcowin.entity.Contact;

@Service
public class ContactBizImpl<T extends Contact> implements ContactBiz<T> {

	@Inject
	private ContactDao dao;

	public boolean add(T entity) throws DataAccessException {
		return dao.add(entity);
	}

	public boolean edit(T entity) throws DataAccessException {
		return dao.edit(entity);
	}

	@SuppressWarnings("unchecked")
	public T getById(Integer id) throws DataAccessException {
		return (T) dao.getById(id);
	}
	@SuppressWarnings("unchecked")
	public List<T> getAll() throws DataAccessException {
		return (List<T>) dao.getAll();
	}

	public void del(int id) throws DataAccessException {
		dao.del(id);

	}

}
